package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.service.IStrategyCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping({"/comments"})
public class StrategyCommentController {

    @Autowired
    IStrategyCommentService strategyCommentService;

    public StrategyCommentController() {
    }

    /**
     * 1.查询最近推荐的10条攻略评论,
     * 按照推荐时间倒序
     *
     * @return
     */
    @GetMapping("/commends")
    public List<StrategyComment> getTopCommends() {
        return this.strategyCommentService.getTopCommends();
    }
}